package com.zhu.ecology;

import java.util.List;

/**
 * Created by Antin_zhu on 2016/2/15.
 */
public class RecordTool {

    public static void main(String[] args){
        String type = Sign.TYPE_OF_WEEK;
        if(args.length > 0){
            type = args[0];
        }

        Sign s = new Sign();
        if(args.length > 1){
            s.setUserName(args[1]);
        }

        if(args.length > 2){
            s.setPassword(args[2]);
        }

        List<DaySign> sList = Sign.TYPE_OF_WEEK.equals(type)?s.getWeekRecord():s.getMonthRecord();
        if(sList != null){
            System.out.println(" --------------[" + s.getUserName() + "]---------------");
            System.out.println(DaySign.SPLIT_STR);
            System.out.println(DaySign.TITLE_DESC);
            for(DaySign ss : sList){
                System.out.println(DaySign.SPLIT_STR);
                System.out.println(ss);
            }
        }
    }
}
